package com.fenghongzhang.module_Teacher.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import com.fenghongzhang.module_user.model.Teacher


@Dao
interface TeacherDao {
    @Query("SELECT * FROM teacher")
    fun getAll(): List<Teacher>

    @Query("SELECT * FROM Teacher WHERE uid IN (:TeacherIds)")
    suspend fun loadAllByIds(TeacherIds: IntArray): List<Teacher>

    @Query("SELECT * FROM Teacher WHERE first_name LIKE :first AND " +
            "last_name LIKE :last LIMIT 1")
    suspend fun findByName(first: String, last: String): Teacher

    @Insert
    suspend fun insertAll(vararg Teachers: Teacher)

    @Delete
    suspend fun delete(Teacher: Teacher)
}